package com.cdtye.itps.cms.service.datasysn;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;


@Slf4j
@Service

public class DetectConsumerService {

    @Autowired
    private PlanDetailService planDetailService;


    /**
     * 处理1C、2C、4C文件包数据获取
     *
     *
     * @param record
     */
    @Async
    public void saveHandleConsumerDefectPlan(ConsumerRecord record) throws Exception {
        log.info("进入1C、2C、4C文件包数据预处理");
        planDetailService.saveConsumerC124DetectJob(record);
    }


    /**
     * 处理检测缺陷数据
     *
     *
     * @param record
     */
    @Async
    public void saveHandleConsumerShuoHuangDefectInfos(ConsumerRecord record) throws Exception {
        log.info("进入朔黄------------检测缺陷预处理");
        planDetailService.saveShuoHuangDetailService(record);
    }

    /**
     * 处理检测计划数据
     *
     *
     * @param record
     */
    @Async
    public void saveHandleConsumerShuoHuangPlanInfos(ConsumerRecord record) throws Exception {
        log.info("进入朔黄------------检测缺陷预处理");
        planDetailService.savePlanDetailService(record);
    }



}
